/*
 * =====================================================================================
 *
 *       Filename:  ipString.h
 *
 *    Description:  use string wrap ip adderss.
 *    				can be used to operate ip 
 *
 *        Version:  1.0
 *        Created:  07/11/2012 09:59:37 PM
 *       Revision:  none
 *       Compiler:  gcc/g++
 *
 *         Author:  wangtengchao , wangtengchao AT gmail.com
 *   Organization:  
 *
 * =====================================================================================
 */
#ifndef IPSTRING_H 
#define IPSTRING_H
#include"netinet/in.h"
#include<string>
namespace inm
{
	namespace net
	{

		using std::string;
		//for ip string like "127.0.0.1"
		class IpString
		{
			private:
				string ip_;
			public:
				IpString(const string& ipString):ip_(ipString){}
				IpString(const in_addr_t& ipAddr);
				//ip string to in_addr_t(presentation to numeric)
                //must be const because return value may be transfered to one function. e.g.  used in inetAddr
                in_addr_t toInAddr() const;
                string toString() const
				{ 
					return ip_;
				}
				
				
		};
	};
};


#endif
